<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/common/meta.jsp"%>
<title>南邮博客注册</title>
<link rel="stylesheet" type="text/css" href="${ctx }/skins/register.css" />
<script type="text/javascript"
	src="${ctx }/scripts/checkInput/register.js"></script>
<script type="text/javascript">var codeEmail;
$(function(){
	$("#TANGRAM__4__email").mousedown(function(){
		$("#TANGRAM__4__tip").css('display','block');
		$("#TANGRAM__4__tip").css('left',420+"px");
		$("#TANGRAM__4__tip").css('top',45+"px");
		$("#TANGRAM__4__tipContainer").text("请输入常用邮箱，通过验证后可用户登录");
	});
	$("#TANGRAM__4__email").blur(function(){
		email = $("#TANGRAM__4__email").val();
		$("#TANGRAM__4__tip").css('display','none');
		checkEmail(email);
	});
	$("#TANGRAM__4__password").mousedown(function(){
		$("#TANGRAM__4__tip").css('display','block');
		$("#TANGRAM__4__tip").css('left',420+"px");
		$("#TANGRAM__4__tip").css('top',92+"px");
		$("#TANGRAM__4__tipContainer").html("密码长度6~14位，区分大小写");
	});
	$("#TANGRAM__4__password").blur(function(){
		password = $("#TANGRAM__4__password").val();
		$("#TANGRAM__4__tip").css('display','none');
		checkPassword(password);
	});
	$("#TANGRAM__4__confirmpassword").blur(function(){
		password = $("#TANGRAM__4__password").val();
		confirmPassword = $("#TANGRAM__4__confirmpassword").val();
		if(confirmPassword.length==0){
			codeEmail=false;
			$("#TANGRAM__4__confirmpasswordError").html("请输入确定密码");
			$("#TANGRAM__4__confirmpassword").css("border-color","#DB1111 #D91111 #D91111");
		}
		else if(password!=confirmPassword){
			codeEmail=false;
			$("#TANGRAM__4__confirmpasswordError").html("密码不一致");
			$("#TANGRAM__4__confirmpassword").css("border-color","#DB1111 #D91111 #D91111");
		}else{
			codeEmail=true;
			$("#TANGRAM__4__confirmpasswordError").html("");
			$("#TANGRAM__4__confirmpassword").css("border-color","#CCCCCC #DDDDDD #DDDDDD #CCCCCC");
			$("#TANGRAM__4__confirmpasswordSucc").css("display","block");
		}
	});
	$("#TANGRAM__4__verifyCodeChange").click(function(){
		$("#TANGRAM__4__verifyCodeImg").attr("src","showCertpic?"+Math.random());
	});
	$("#TANGRAM__4__verifyCode").mousedown(function(){
		$("#TANGRAM__4__tip").css('display','block');
		$("#TANGRAM__4__tip").css('left',420+"px");
		$("#TANGRAM__4__tip").css('top',233+"px");
		$("#TANGRAM__4__tipContainer").html("请输入图片中的字符，不区分大小写");
	});
	$("#TANGRAM__4__verifyCode").blur(function(){
		verifyCode = $("#TANGRAM__4__verifyCode").val();
		$("#TANGRAM__4__tip").css('display','none');
		checkVerifyCode(verifyCode);
	});
	$("#userAuthority_authority").blur(function(){
		$("#TANGRAM__4__tip").css('display','none');
	});
});
function beforeSubmit(){
	$("#TANGRAM__4__form input[type='text']").each(function(i){
		if(this.value.length==0){
			codeEmail = false;
			return false;
		}
	});
	$("#TANGRAM__4__form input[type='password']").each(function(i){
		if(this.value.length==0){
			codeEmail = false;
			return false;
		}
	});
	return codeEmail;
}
</script>
</head>
<body>
	<div class="mod-header grid-96">
		<div class="logo">
			<a href="${ctx }/"><img alt="njupt_blog"
				src="${ctx}/img/njupt.jpg"> </a>
		</div>
	</div>
	<div class="mod-bread clearfix">
		<div class="grid-96 mod-navbar">
			<div class="bread-left clearfix">
				<a class="mail_reg_tab" id="mailRegTab">邮箱注册</a>
			</div>
			<div class="bread-right">
				已有帐号？<a id="floatLogin" href="${ctx }/login.jsp">马上登录</a>
			</div>
		</div>
	</div>
	<div class="mod-regcontent grid-96 tang-pass-reg" id="normal_reg">
		<form autocomplete="off" id="TANGRAM__4__form" method="POST"
			action="${ctx }/user/register.action">
			<p id="TANGRAM__4__errorWrapper" class="pass-generalErrorWrapper">
				<span id="TANGRAM__4__error" class="pass-generalError"></span>
			</p>
			<p id="TANGRAM__4__hiddenFields" style="display: none">
				<input type="hidden" name="user.accountNonExpired" value="" /> <input
					type="hidden" name="user.accountNonLocked" value="" />
				<input name="userAuthority.authority" type="hidden" value="customer"/>
			</p>
			<p id="TANGRAM__4__emailWrapper"
				class="pass-form-item pass-form-item-email" style="display: block">
				<label for="TANGRAM__4__email" id="TANGRAM__4__emailLabel"
					class="pass-label pass-label-email"> 邮箱</label><input
					id="TANGRAM__4__email" type="text" name="user.username"
					class="pass-text-input pass-text-input-email"
					value="${param.user.username}"> <span
					id="TANGRAM__4__emailError"
					class="pass-item-error pass-item-error-email"></span> <span
					id="TANGRAM__4__emailSucc"
					class="pass-item-succ pass-item-succ-email" style="display: none;"></span>
			</p>
			<p id="TANGRAM__4__passwordWrapper"
				class="pass-form-item pass-form-item-password"
				style="display: block">
				<label for="TANGRAM__4__password" id="TANGRAM__4__passwordLabel"
					class="pass-label pass-label-password">密码</label> <input
					id="TANGRAM__4__password" type="password" name="user.password"
					class="pass-text-input pass-text-input-password"
					value="${param.user.password}"> <span
					id="TANGRAM__4__passwordError"
					class="pass-item-error pass-item-error-password"></span> <span
					id="TANGRAM__4__passwordSucc"
					class="pass-item-succ pass-item-succ-password"
					style="display: none;"></span>
			</p>
			<p id="TANGRAM__4__confirmpasswordWrapper"
				class="pass-form-item pass-form-item-password"
				style="display: block">
				<label for="TANGRAM__4__password"
					id="TANGRAM__4__confirmpasswordLabel"
					class="pass-label pass-label-password">确认密码</label> <input
					id="TANGRAM__4__confirmpassword" type="password"
					name="confirmpassword"
					class="pass-text-input pass-text-input-password"
					value="${param.confirmpassword}"> <span
					id="TANGRAM__4__confirmpasswordError"
					class="pass-item-error pass-item-error-password"></span> <span
					id="TANGRAM__4__confirmpasswordSucc"
					class="pass-item-succ pass-item-succ-confirmpassword"
					style="display: none;"></span>
			</p>
			<p id="TANGRAM__4__verifyCodeImgWrapper"
				class="pass-form-item pass-form-item-verifyCode"
				style="display: block;">
				<label for="TANGRAM__4__verifyCode" id="TANGRAM__4__verifyCodeLabel"
					class="pass-label pass-label-verifyCode">验证码</label><input
					id="TANGRAM__4__verifyCode" type="text" name="verifyCode"
					class="pass-text-input pass-text-input-verifyCode" maxlength="4"><span><img
					id="TANGRAM__4__verifyCodeImg" title="验证码图片" alt="验证码图片"
					class="pass-verifyCode" src="showCertpic"> </span><a
					id="TANGRAM__4__verifyCodeChange" href="#"
					class="pass-change-verifyCode">看不清？</a><span
					id="TANGRAM__4__verifyCodeError"
					class="pass-item-error pass-item-error-verifyCode">${msg}</span>
			</p>
			<p id="TANGRAM__4__submitWrapper"
				class="pass-form-item pass-form-item-submit">
				<input id="TANGRAM__4__submit" type="submit" value="注册"
					name="method:register" class="pass-button pass-button-submit"
					onclick="return beforeSubmit();"><span
					id="TANGRAM__4__isAgreeError"
					class="pass-item-error pass-item-error-isAgree"></span>
			</p>
			<div id="TANGRAM__4__tip" class="pass-pop-tip" style="display: none">
				<div class="pass-pop-tip-header"></div>
				<div class="pass-pop-tip-container">
					<div class="pass-pop-tip-body">
						<div class="pass-pop-tip-content" id="TANGRAM__4__tipContainer"></div>
					</div>
				</div>
			</div>
		</form>
	</div>
</body>

</html>